package org.marketlive.entity.account;

/*
(C) Copyright MarketLive. 2006. All rights reserved.
MarketLive is a trademark of MarketLive, Inc.
Warning: This computer program is protected by copyright law and international treaties.
Unauthorized reproduction or distribution of this program, or any portion of it, may result
in severe civil and criminal penalties, and will be prosecuted to the maximum extent
possible under the law.
*/

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.Set;

import org.marketlive.entity.IEntity;

/**
 * Interface to the Customer entity which contains detailed information about the individual making the purchase.
 */
public interface ICustomer extends IEntity {

    /**
     * Returns the <code>AccountSet</code> which the Customer implementation belongs to.
     *
     * @return The AccountSet
     */
    IAccountSet getAccountSet();

    /**
     * Sets the <code>AccountSet</code> which the customer implementation belongs to.
     *
     * @param accountSet
     */
    void setAccountSet(IAccountSet accountSet);

    /**
     * Returns the email address of the Customer.
     *
     * @return email property's String value
     */
    String getEmail();

    /**
     * Sets the email address of the Customer.
     *
     * @param email property's new String value
     */
    void setEmail(final String email);

    /**
     * Returns the user name of the Customer.
     *
     * @return userName property's String value
     */
    String getUserName();

    /**
     * Sets the user name for the Customer.
     *
     * @param userName property's new String value
     */
    void setUserName(final String userName);

    /**
     * Return the code of this Customer.
     *
     * @return code property's String value
     */
    String getCode();

    /**
     * Sets the code for the Customer.
     *
     * @param code property's new String value
     */
    void setCode(final String code);

    /**
     * Returns the password for the Customer.
     *
     * @return password property's String value
     */
    String getPassword();

    /**
     * Sets the password for the Customer.
     *
     * @param password property's new String value
     */
    void setPassword(final String password);

    /**
     * Returns the hint chosen by the Customer for password recovery.
     *
     * @return hint property's IHint value
     */
    IHint getHint();

    /**
     * Sets the hint chosen by the Customer for password recovery.
     *
     * @param hint property's new IHint value
     */
    void setHint(final IHint hint);

    /**
     * Returns the hint answer of the Customer.
     *
     * @return hintAnswer property's String value
     */
    String getHintAnswer();

    /**
     * Sets the hint answer of the Customer.
     *
     * @param hintAnswer property's new String value
     */
    void setHintAnswer(final String hintAnswer);

    /**
     * Returns the guest status of the customer.
     *
     * @return boolean true if customer is a guest, else false
     */
    boolean isGuest();

    /**
     * Sets the guest status of the customer.
     *
     * @param guest boolean value; true if a guest, else false
     */
    void setGuest(final boolean guest);

    /**
     * Returns the deleted status of the customer.
     *
     * @return deleted boolean value; true if a deleted, else false
     */
    boolean isDeleted();

    /**
     * Sets the deleted status of the customer.
     *
     * @param deleted boolean value; true if a deleted, else false
     */
    void setDeleted(final boolean deleted);

    /**
     * Returns the date the customer account was deleted.
     *
     * @return dateDeleted property's Date value
     */
    Date getDateDeleted();

    /**
     * Sets the date the customer account was deleted.
     *
     * @param dateDeleted property's Date value
     */
    void setDateDeleted(Date dateDeleted);

    /**
     * Returns the key code reference for the encrypted password.
     *
     * @return keyCode property's String value
     */
    String getKeyCode();

    /**
     * Sets the key code reference for the encrypted password.
     *
     * @param keyCode property's String value
     */
    void setKeyCode(String keyCode);

    /**
     * Returns a set of contact entities for the customer.
     *
     * @return contact property's Set of contact entities
     */
    Set getContacts();

    /**
     * Sets the contact set for the customer to the given set of contact entities.
     *
     * @param contacts property's Set of contact entities
     */
    void setContacts(Set contacts);

    /**
     * Adds a contact to the customer's contact list.
     *
     * @param contact to add to the contact entity
     */
    void addContact(IContact contact);

    /**
     * Removes a contact from the customer's contact list.
     *
     * @param contact to remove
     */
    void removeContact(IContact contact);

    /**
     * Removes all contacts from the customer's contact list.
     */
    void removeAllContacts();

    /**
     * Returns a Set of <code>Contact</code> entities that are in this customer's address book.
     *
     * @return a Set of contact entities
     */
    Set getContactsInAddressBook();

    /**
     * Does the customer have contacts in their address book (convenience method).
     *
     * @return true if customer has contacts in address book, else false
     */
    boolean hasContactsInAddressBook();

    /**
     * Returns a set of <code>Order</code> entities for the customer.
     *
     * @return Set of order entities
     */
    Set getOrders();

    /**
     * Sets the <code>Order</code> set for the customer to the given set of order entities.
     *
     * @param orders Set of order entities.
     */
    void setOrders(Set orders);


    /**
     * Convenience method for loading customer primary contact.
     *
     * @return Instance of IContact or null if none of the associated contacts are marked as "primary", which should
     *         never happen!
     */
    public IContact getPrimaryContact();

    /**
     * Returns a collection of <code>WishList</code>s for the customer.
     *
     * @return List of wishLists assigned to the customer
     */
    List getWishLists();

    /**
     * Sets a collection of <code>WishList</code>s for the customer.
     *
     * @param wishLists List for the customer
     */
    void setWishLists(List wishLists);

    /**
     * Removes all assigned <code>WishList</code>s from the customer.
     */
    void removeAllWishLists();

    /**
     * Returns a user-friendly identifier for this <code>ICustomer</code>.
     * It is a descriptive identifier, and is not guaranteed to be unique.
     *
     * @return  String  the name
     */
    String getName();

    /**
     * Sets the name of this <code>ICustomer</code>.
     * It is a descriptive identifier, not guaranteed to be unique.
     *
     * @param name the name.
     */
    void setName(String name);

    /**
     * Returns the customer's locale code (e.g., fr_CA, or es).
     *
     * @return  String  the customer's locale.
     */
    String getLocale();

    /** Sets the customer's locale.
     *
     * @param locale    the locale code.
     */
    void setLocale(String locale);
}
